//package test.patches;
//
//import com.evacipated.cardcrawl.modthespire.lib.*;
//import com.evacipated.cardcrawl.modthespire.patcher.PatchingException;
//import com.megacrit.cardcrawl.cards.AbstractCard;
//import com.megacrit.cardcrawl.cards.CardGroup;
//import com.megacrit.cardcrawl.cards.DamageInfo;
//import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
//import com.megacrit.cardcrawl.monsters.AbstractMonster;
//import javassist.CannotCompileException;
//import javassist.CtBehavior;
//import mutsumimod.patches.BreakPowerPatch;
//import mutsumimod.patches.CopyPatch;
//import test.character.Captain;
//import test.monitors.SeaMonitor;
//import test.utils.tags.CaptainTags;
//
//import java.util.ArrayList;
//
//public class ShadowPatch {
//
//    public static final float TRANSPARENCY=0.7f;
//
//    public static void setCardTransparency(AbstractCard __instance){
//        if(__instance.hasTag(CaptainTags.EXHAUST_OUT_HAND)){
//            __instance.transparency=TRANSPARENCY;
//            __instance.targetTransparency=TRANSPARENCY;
//        }
//    }
//
//    @SpirePatch(
//            clz = AbstractCard.class,
//            method = "update"
//    )
//    public static class CardTransparencyPatch {
//        @SpirePrefixPatch
//        public static void prefix(AbstractCard __instance) {
//            if(__instance.hasTag(CaptainTags.EXHAUST_OUT_HAND)){
//                if(__instance.transparency>TRANSPARENCY){
//                    __instance.transparency=TRANSPARENCY;
//                }
//                if(__instance.targetTransparency>TRANSPARENCY){
//                    __instance.targetTransparency=TRANSPARENCY;
//                }
//            }
//        }
//    }
//
//
////    @SpirePatch(
////            clz = AbstractCard.class,
////            method = SpirePatch.CONSTRUCTOR,
////            paramtypez = {
////                String.class, String.class, String.class, int.class, String.class,
////                    AbstractCard.CardType.class, AbstractCard.CardColor.class, AbstractCard.CardRarity.class, AbstractCard.CardTarget.class, DamageInfo.DamageType.class
////            }
////    )
////    public static class CardTransparencyPatch {
////        @SpirePrefixPatch
////        public static void prefix(AbstractCard __instance,String id, String name, String imgUrl, int cost, String rawDescription, AbstractCard.CardType type, AbstractCard.CardColor color, AbstractCard.CardRarity rarity, AbstractCard.CardTarget target, DamageInfo.DamageType dType) {
////            setCardTransparency(__instance);
////        }
////    }
////
////    @SpirePatch(
////            clz = AbstractCard.class,
////            method = SpirePatch.CONSTRUCTOR,
////            paramtypez = {
////                AbstractCard.class
////            }
////    )
////    public static class CardTransparencyPatch2 {
////        @SpirePrefixPatch
////        public static void prefix(AbstractCard __instance,AbstractCard c) {
////            setCardTransparency(__instance);
////        }
////    }
//
////    @SpirePatch(
////            clz = AbstractCard.class,
////            method = "unfadeOut"
////    )
////    public static class CardTransparencyPatch3 {
////        @SpireInsertPatch(
////            locator = Locator.class
////        )
////        public static void insert(AbstractCard __instance) {
////            setCardTransparency(__instance);
////        }
////
////        private static class Locator extends SpireInsertLocator {
////            public int[] Locate(CtBehavior ctMethodToPatch) throws CannotCompileException, PatchingException {
////                Matcher finalMatcher = new Matcher.FieldAccessMatcher(AbstractCard.class, "targetTransparency");
////
////                int[] lines = LineFinder.findInOrder(ctMethodToPatch, new ArrayList<Matcher>(), finalMatcher);
////                return new int[]{lines[0]+1};
////            }
////        }
////
////    }
//
//
//    public static SpireReturn targetExhaustPile(CardGroup __instance, AbstractCard c){
//        if(c.hasTag(CaptainTags.EXHAUST_OUT_HAND)){
//            __instance.moveToExhaustPile(c);
//            return SpireReturn.Return();
//        }
//        return SpireReturn.Continue();
//    }
//
//    @SpirePatch(
//            clz = CardGroup.class,
//            method = "moveToDiscardPile"
//    )
//    public static class MoveToDiscardPilePatch {
//        @SpirePrefixPatch
//        public static SpireReturn prefix(CardGroup __instance, AbstractCard c) {
//            return targetExhaustPile(__instance, c);
//        }
//    }
//
//    @SpirePatch(
//            clz = CardGroup.class,
//            method = "moveToDeck"
//    )
//    public static class MoveToDeckPatch {
//        @SpirePrefixPatch
//        public static SpireReturn prefix(CardGroup __instance, AbstractCard c,boolean randomSpot) {
//            return targetExhaustPile(__instance, c);
//        }
//    }
//
//    @SpirePatch(
//            clz = CardGroup.class,
//            method = "moveToBottomOfDeck"
//    )
//    public static class MoveToBottomOfDeckPatch {
//        @SpirePrefixPatch
//        public static SpireReturn prefix(CardGroup __instance, AbstractCard c) {
//            return targetExhaustPile(__instance, c);
//        }
//    }
//
//}
